<?php

namespace App\Models\Music;

use App\Models\BaseModel;

/**
 * 用户模型层
 *
 * Class Role
 * @package App\Models\Adv
 */
class MusicCheck extends BaseModel
{
    /**
     * The table associated with the model.
     *
     * @var string
     */
    public $table = 'music_check';
    public $is_commond = [1 => '不推荐',2 => '推荐'];
    public $appends = ['is_commond_text'];
    public $dates = [];
    /**
     * Indicates if the model should be timestamped.
     * @var bool
     */
    public $timestamps = false;

    public function music(){
        return $this->belongsTo('App\Models\Music\Music','music_id','id');
    }

    public function user(){
        return $this->hasManyThrough('App\Models\Agent\Agent','App\Models\User\UsersInfo','id','software_id','user_id','software_id');
    }

    public function getIsCommondTextAttribute()
    {
        return $this->is_commond[$this['is_commond']];
    }

}
